package cn.cs.client;

import cn.cs.common.Page;
import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AdBannerFallBack;
import cn.cs.fallback.ProductFallBack;
import cn.cs.pojo.AdBanner;
import cn.cs.pojo.AgentShop;
import cn.cs.pojo.CsParts;
import cn.cs.pojo.Product;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-shop-provider", configuration = CsConfiguration.class, fallback = ProductFallBack.class)
public interface ProductClient {

    @RequestMapping(value = "/getProductListPageByMap", method = RequestMethod.POST)
    public List<Product> getProductListPageByMap(@RequestBody Map<String,Object> param)throws Exception;

    @RequestMapping(value = "/getProductCountByMap", method = RequestMethod.POST)
    public Integer getProductCountByMap(@RequestBody Map<String,Object> param)throws Exception;

    @RequestMapping(value = "/getPlatFromProImages", method = RequestMethod.POST)
    List<String> getPlatFromProImages(@RequestParam("proId") String proId);
    @RequestMapping(value = "/getProductById", method = RequestMethod.POST)
    Product getProductById(@RequestParam("proId")String proId);
    @RequestMapping(value = "/getCellCount", method = RequestMethod.POST)
    int getCellCount(@RequestParam("proId")String proId);
    @RequestMapping(value = "/getProImagesByProId", method = RequestMethod.POST)
    List<Map<String,Object>> getProImagesByProId(@RequestParam("id")String id);
    @RequestMapping(value = "/getProEvaluatesByProId", method = RequestMethod.POST)
    List<Map<String,Object>> getProEvaluatesByProId(@RequestParam("id")String id);
    @RequestMapping(value = "/getShopById", method = RequestMethod.POST)
    AgentShop getShopById(@RequestParam("shopId")String shopId);
    @RequestMapping(value = "/getProductListByMap", method = RequestMethod.POST)
    List<Product> getProductListByMap(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/getShopPro", method = RequestMethod.POST)
    List<Map<String,Object>> getShopPro(@RequestBody Map<String, Object> map);
    @RequestMapping(value = "/showProduct", method = RequestMethod.POST)
    List<CsParts> showProduct(@RequestBody Map<String, Object> param);
}

